package com.example.CarManagement.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.example.CarManagement.enumPojo.OrderStatus;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单表，记录派车信息和实际用车情况
 * </p>
 *
 * @author 徐佳彪
 * @since 2025-07-23
 */
@TableName("c_orders")
public class Orders implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单ID，主键自增
     */
    private String id;

    /**
     * 订单编号，格式如ORD-YYYYMMDD-001，唯一
     */
    private String orderNumber;

    /**
     * 关联的申请ID，关联applications表，唯一
     */
    private String applicationId;

    /**
     * 派单员ID，关联users表
     */
    private String dispatcherId;

    /**
     * 派单时间
     */
    private LocalDateTime dispatchTime;

    /**
     * 分配的车辆ID，关联vehicles表
     */
    private String vehicleId;

    /**
     * 分配的司机ID，关联drivers表
     */
    private String driverId;

    /**
     * 实际开始时间
     */
    private LocalDateTime actualStartTime;

    /**
     * 实际结束时间
     */
    private LocalDateTime actualEndTime;

    /**
     * 实际行驶里程(公里)
     */
    private BigDecimal actualMileage;

    /**
     * 燃油费用
     */
    private BigDecimal fuelCost;

    /**
     * 其他费用
     */
    private BigDecimal otherCost;

    /**
     * 订单状态：dispatched-已派车，in_progress-进行中，completed-已完成，cancelled-已取消
     */
    private OrderStatus status;

    /**
     * 用户评分，1-5星
     */
    private Integer rating;

    /**
     * 用户反馈意见
     */
    private String feedback;

    /**
     * 记录创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 记录最后更新时间
     */
    private LocalDateTime updatedAt;

    private Byte deleted;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public String getDispatcherId() {
        return dispatcherId;
    }

    public void setDispatcherId(String dispatcherId) {
        this.dispatcherId = dispatcherId;
    }

    public LocalDateTime getDispatchTime() {
        return dispatchTime;
    }

    public void setDispatchTime(LocalDateTime dispatchTime) {
        this.dispatchTime = dispatchTime;
    }

    public String getVehicleId() {
        return vehicleId;
    }

    public void setVehicleId(String vehicleId) {
        this.vehicleId = vehicleId;
    }

    public String getDriverId() {
        return driverId;
    }

    public void setDriverId(String driverId) {
        this.driverId = driverId;
    }

    public LocalDateTime getActualStartTime() {
        return actualStartTime;
    }

    public void setActualStartTime(LocalDateTime actualStartTime) {
        this.actualStartTime = actualStartTime;
    }

    public LocalDateTime getActualEndTime() {
        return actualEndTime;
    }

    public void setActualEndTime(LocalDateTime actualEndTime) {
        this.actualEndTime = actualEndTime;
    }

    public BigDecimal getActualMileage() {
        return actualMileage;
    }

    public void setActualMileage(BigDecimal actualMileage) {
        this.actualMileage = actualMileage;
    }

    public BigDecimal getFuelCost() {
        return fuelCost;
    }

    public void setFuelCost(BigDecimal fuelCost) {
        this.fuelCost = fuelCost;
    }

    public BigDecimal getOtherCost() {
        return otherCost;
    }

    public void setOtherCost(BigDecimal otherCost) {
        this.otherCost = otherCost;
    }

    public OrderStatus getStatus() {
        return status;
    }

    public void setStatus(OrderStatus status) {
        this.status = status;
    }

    public Integer getRating() {
        return rating;
    }

    public void setRating(Integer rating) {
        this.rating = rating;
    }

    public String getFeedback() {
        return feedback;
    }

    public void setFeedback(String feedback) {
        this.feedback = feedback;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Byte getDeleted() {
        return deleted;
    }

    public void setDeleted(Byte deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "Orders{" +
            "id = " + id +
            ", orderNumber = " + orderNumber +
            ", applicationId = " + applicationId +
            ", dispatcherId = " + dispatcherId +
            ", dispatchTime = " + dispatchTime +
            ", vehicleId = " + vehicleId +
            ", driverId = " + driverId +
            ", actualStartTime = " + actualStartTime +
            ", actualEndTime = " + actualEndTime +
            ", actualMileage = " + actualMileage +
            ", fuelCost = " + fuelCost +
            ", otherCost = " + otherCost +
            ", status = " + status +
            ", rating = " + rating +
            ", feedback = " + feedback +
            ", createdAt = " + createdAt +
            ", updatedAt = " + updatedAt +
            ", deleted = " + deleted +
        "}";
    }
}
